using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;

using System.Reflection;
using Gizmox.WebGUI.Common.Resources;
using Gizmox.WebGUI.Forms;

using System.IO;
using TVC.Layout;

namespace TVC.Modules.Com
{
    /// <summary>
    /// Summary description for CustomWindowPanelControl.
    /// </summary>

    [Serializable()]
    public class POG : ModuleParent, IHostedApplication
    {
        private TabControl tabControl1;
        private TabPage tbList;
        private TabPage tbDetail;
        private Label label2;
        private TextBox txtROLE_NAME;
        private TextBox txtROLE_ID;
        private Label label1;
        private Label label10;
        private Label label8;
        private Label label7;
        private TextBox txtPASS_VALID;
        private TextBox txtPASS_MIN_LEN;
        private GroupBox groupBox2;
        private GroupBox groupBox1;
        //string _processStatus = "";
        //string _strType = "POG";
        //string sErr = "";
        private DataGridView dgvList;
        private DataGridViewTextBoxColumn colROLE_ID;
        private DataGridViewTextBoxColumn colROLE_NAME;
        private BindingSource bisPOG;
        private IContainer components;
        private CustomControl.MultiColumnCombo mcbRPT_CODE;
        GridLayout layout = null;
        private ContextMenu ctmGrid;
        private MenuItem menuItem1;
        private MenuItem mnuSaveLayout;
        private MenuItem mnuResetLayout;
        private MenuItem mnuShowFilter;
        private string strAction;
        public POG()
        {
            // This call is required by the WebGUI Form Designer.
            InitializeComponent();
            _strType = "POG";
            _dgvList = dgvList;
            _tabControl = tabControl1;
        }

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        int idAllowEditLanguage = 1;
        int idAddNew = 31;
        int idEdit = 32;
        int idDelete = 33;
        int idTransferIn = 34;
        int idTransferOut = 35;
        int idPrint = 36;
        int idToExcel = 262;


        

        protected override void LoadLanguage(string language)
        {
            foreach (Control x in tbDetail.Controls)
            {
                if (x is Label)
                {
                    clsConfigurarion.GetLabel(this.ToString(), x, language);
                }
                if (x is GroupBox || x is ExpandableGroupBox || x is Panel)
                {
                    clsConfigurarion.GetLabel(this.ToString(), x, language);
                    foreach (Control y in x.Controls)
                    {
                        if (y is Label)
                            clsConfigurarion.GetLabel(this.ToString(), y, language);
                    }
                }
            }
           
            if (this.Parent is HeaderedPanel)
            {
                HeaderedPanel pln = this.Parent as HeaderedPanel;
                _title = clsConfigurarion.GetLabel(this.ToString(), "", null, language);
            }
        }
        public HostedToolBarElement[] GetToolBarElements()
        {
            ArrayList objElements = new ArrayList();
            if (IsPermis(idAddNew))
                objElements.Add(new HostedToolBarButton("Add New", new IconResourceHandle("Add.png"), "C"));
            if (IsPermis(idEdit))
                objElements.Add(new HostedToolBarButton("Edit", new IconResourceHandle("Edit.png"), "A"));
            if (IsPermis(idAddNew) && IsPermis(idEdit))
                objElements.Add(new HostedToolBarButton("Save", new IconResourceHandle("Save.png"), "S"));
            if (IsPermis(idAddNew))
                objElements.Add(new HostedToolBarButton("Copy", new IconResourceHandle("Copy.png"), "O"));
            if (IsPermis(idDelete))
                objElements.Add(new HostedToolBarButton("Delete", new IconResourceHandle("Delete.png"), "X"));

            objElements.Add(new HostedToolBarSeperator());
            if (IsPermis(idTransferIn))
                objElements.Add(new HostedToolBarButton("Import", new IconResourceHandle("Down.png"), "TI"));
            if (IsPermis(idPrint)) objElements.Add(new HostedToolBarButton("To XML", "To XML", new IconResourceHandle("Up.png"), "TO"));
            if (IsPermis(idToExcel)) objElements.Add(new HostedToolBarButton("To Excel", "To Excel", new IconResourceHandle("Excel.png"), "EXCEL"));

            objElements.Add(new HostedToolBarSeperator());
            objElements.Add(new HostedToolBarButton("Refresh", new IconResourceHandle("Refresh.png"), "R"));

            return (HostedToolBarElement[])objElements.ToArray(typeof(HostedToolBarElement));
        }


        #region Component Designer generated code
        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            Gizmox.WebGUI.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new Gizmox.WebGUI.Forms.DataGridViewCellStyle();
            Gizmox.WebGUI.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new Gizmox.WebGUI.Forms.DataGridViewCellStyle();
            this.tabControl1 = new Gizmox.WebGUI.Forms.TabControl();
            this.tbList = new Gizmox.WebGUI.Forms.TabPage();
            this.dgvList = new Gizmox.WebGUI.Forms.DataGridView();
            this.colROLE_ID = new Gizmox.WebGUI.Forms.DataGridViewTextBoxColumn();
            this.colROLE_NAME = new Gizmox.WebGUI.Forms.DataGridViewTextBoxColumn();
            this.ctmGrid = new Gizmox.WebGUI.Forms.ContextMenu();
            this.menuItem1 = new Gizmox.WebGUI.Forms.MenuItem();
            this.mnuSaveLayout = new Gizmox.WebGUI.Forms.MenuItem();
            this.mnuResetLayout = new Gizmox.WebGUI.Forms.MenuItem();
            this.mnuShowFilter = new Gizmox.WebGUI.Forms.MenuItem();
            this.bisPOG = new Gizmox.WebGUI.Forms.BindingSource(this.components);
            this.tbDetail = new Gizmox.WebGUI.Forms.TabPage();
            this.groupBox2 = new Gizmox.WebGUI.Forms.GroupBox();
            this.mcbRPT_CODE = new TVC.Modules.CustomControl.MultiColumnCombo();
            this.label10 = new Gizmox.WebGUI.Forms.Label();
            this.groupBox1 = new Gizmox.WebGUI.Forms.GroupBox();
            this.label8 = new Gizmox.WebGUI.Forms.Label();
            this.txtPASS_MIN_LEN = new Gizmox.WebGUI.Forms.TextBox();
            this.txtPASS_VALID = new Gizmox.WebGUI.Forms.TextBox();
            this.label7 = new Gizmox.WebGUI.Forms.Label();
            this.label2 = new Gizmox.WebGUI.Forms.Label();
            this.txtROLE_NAME = new Gizmox.WebGUI.Forms.TextBox();
            this.txtROLE_ID = new Gizmox.WebGUI.Forms.TextBox();
            this.label1 = new Gizmox.WebGUI.Forms.Label();
            ((System.ComponentModel.ISupportInitialize)(this.tabControl1)).BeginInit();
            this.tabControl1.SuspendLayout();
            this.tbList.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.dgvList)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.bisPOG)).BeginInit();
            this.tbDetail.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox1.SuspendLayout();
            this.SuspendLayout();
            // 
            // errProvider
            // 
            this.errProvider.BlinkStyle = Gizmox.WebGUI.Forms.ErrorBlinkStyle.BlinkIfDifferentError;
            // 
            // warnProvider
            // 
            this.warnProvider.BlinkStyle = Gizmox.WebGUI.Forms.ErrorBlinkStyle.BlinkIfDifferentError;
            // 
            // tabControl1
            // 
            this.tabControl1.Alignment = Gizmox.WebGUI.Forms.TabAlignment.Bottom;
            this.tabControl1.Appearance = Gizmox.WebGUI.Forms.TabAppearance.Workspace;
            this.tabControl1.Controls.Add(this.tbList);
            this.tabControl1.Controls.Add(this.tbDetail);
            this.tabControl1.Dock = Gizmox.WebGUI.Forms.DockStyle.Fill;
            this.tabControl1.Location = new System.Drawing.Point(3, 3);
            this.tabControl1.Name = "tabControl1";
            this.tabControl1.SelectedIndex = 0;
            this.tabControl1.Size = new System.Drawing.Size(601, 442);
            this.tabControl1.TabIndex = 0;
            // 
            // tbList
            // 
            this.tbList.Controls.Add(this.dgvList);
            this.tbList.Dock = Gizmox.WebGUI.Forms.DockStyle.Fill;
            this.tbList.Location = new System.Drawing.Point(4, 22);
            this.tbList.Name = "tbList";
            this.tbList.Size = new System.Drawing.Size(593, 416);
            this.tbList.TabIndex = 0;
            this.tbList.Text = "List";
            // 
            // dgvList
            // 
            this.dgvList.AllowDrag = false;
            this.dgvList.AllowUserToAddRows = false;
            this.dgvList.AllowUserToDeleteRows = false;
            this.dgvList.AutoGenerateColumns = false;
            this.dgvList.BackgroundColor = System.Drawing.Color.White;
            this.dgvList.ColumnHeadersHeightSizeMode = Gizmox.WebGUI.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dgvList.Columns.AddRange(new Gizmox.WebGUI.Forms.DataGridViewColumn[] {
            this.colROLE_ID,
            this.colROLE_NAME});
            this.dgvList.ContextMenu = this.ctmGrid;
            this.dgvList.DataSource = this.bisPOG;
            this.dgvList.Dock = Gizmox.WebGUI.Forms.DockStyle.Fill;
            this.dgvList.Location = new System.Drawing.Point(0, 0);
            this.dgvList.Name = "dgvList";
            this.dgvList.RowHeadersWidth = 25;
            this.dgvList.RowTemplate.DefaultCellStyle.FormatProvider = new System.Globalization.CultureInfo("en-US");
            this.dgvList.ShowFilterRow = true;
            this.dgvList.Size = new System.Drawing.Size(593, 416);
            this.dgvList.TabIndex = 0;
            // 
            // colROLE_ID
            // 
            this.colROLE_ID.DataPropertyName = "ROLE_ID";
            this.colROLE_ID.DefaultCellStyle = dataGridViewCellStyle1;
            this.colROLE_ID.HeaderText = "Group#";
            this.colROLE_ID.Name = "colROLE_ID";
            this.colROLE_ID.ReadOnly = true;
            // 
            // colROLE_NAME
            // 
            this.colROLE_NAME.AutoSizeMode = Gizmox.WebGUI.Forms.DataGridViewAutoSizeColumnMode.Fill;
            this.colROLE_NAME.DataPropertyName = "ROLE_NAME";
            this.colROLE_NAME.DefaultCellStyle = dataGridViewCellStyle2;
            this.colROLE_NAME.HeaderText = "Description";
            this.colROLE_NAME.Name = "colROLE_NAME";
            this.colROLE_NAME.ReadOnly = true;
            // 
            // ctmGrid
            // 
            this.ctmGrid.MenuItems.AddRange(new Gizmox.WebGUI.Forms.MenuItem[] {
            this.menuItem1,
            this.mnuShowFilter});
            // 
            // menuItem1
            // 
            this.menuItem1.Index = 0;
            this.menuItem1.MenuItems.AddRange(new Gizmox.WebGUI.Forms.MenuItem[] {
            this.mnuSaveLayout,
            this.mnuResetLayout});
            this.menuItem1.Text = "Layout";
            // 
            // mnuSaveLayout
            // 
            this.mnuSaveLayout.Index = 0;
            this.mnuSaveLayout.Tag = "SAVE";
            this.mnuSaveLayout.Text = "Save Layout";
            // 
            // mnuResetLayout
            // 
            this.mnuResetLayout.Index = 1;
            this.mnuResetLayout.Tag = "RESET";
            this.mnuResetLayout.Text = "Reset Layout";
            // 
            // mnuShowFilter
            // 
            this.mnuShowFilter.Index = 1;
            this.mnuShowFilter.Tag = "FILTER";
            this.mnuShowFilter.Text = "Filter Records";
            // 
            // bisPOG
            // 
            this.bisPOG.DataSource = typeof(DTO.POGInfo);
            // 
            // tbDetail
            // 
            this.tbDetail.Controls.Add(this.groupBox2);
            this.tbDetail.Controls.Add(this.groupBox1);
            this.tbDetail.Controls.Add(this.label2);
            this.tbDetail.Controls.Add(this.txtROLE_NAME);
            this.tbDetail.Controls.Add(this.txtROLE_ID);
            this.tbDetail.Controls.Add(this.label1);
            this.tbDetail.Dock = Gizmox.WebGUI.Forms.DockStyle.Fill;
            this.tbDetail.Location = new System.Drawing.Point(0, 0);
            this.tbDetail.Name = "tbDetail";
            this.tbDetail.Size = new System.Drawing.Size(593, 416);
            this.tbDetail.TabIndex = 1;
            this.tbDetail.Text = "Detail";
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.mcbRPT_CODE);
            this.groupBox2.Controls.Add(this.label10);
            this.groupBox2.FlatStyle = Gizmox.WebGUI.Forms.FlatStyle.Flat;
            this.groupBox2.Location = new System.Drawing.Point(19, 73);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(522, 69);
            this.groupBox2.TabIndex = 5;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Default";
            // 
            // mcbRPT_CODE
            // 
            this.mcbRPT_CODE.AllowDrag = false;
            this.mcbRPT_CODE.AutoScroll = false;
            this.mcbRPT_CODE.AutoValidate = Gizmox.WebGUI.Forms.AutoValidate.Disable;
            this.mcbRPT_CODE.Binding = null;
            this.mcbRPT_CODE.DisplayField = null;
            this.mcbRPT_CODE.DisplayRows = 0;
            this.mcbRPT_CODE.Filter = false;
            this.mcbRPT_CODE.KeyPressChk = false;
            this.mcbRPT_CODE.Layout = null;
            this.mcbRPT_CODE.Location = new System.Drawing.Point(96, 19);
            this.mcbRPT_CODE.Lookup = null;
            this.mcbRPT_CODE.MainForm = null;
            this.mcbRPT_CODE.Name = "mcbRPT_CODE";
            this.mcbRPT_CODE.RowData = null;
            this.mcbRPT_CODE.RowDatas = null;
            this.mcbRPT_CODE.Size = new System.Drawing.Size(161, 20);
            this.mcbRPT_CODE.TabIndex = 1;
            this.mcbRPT_CODE.Value = "";
            this.mcbRPT_CODE.ValueField = null;
            // 
            // label10
            // 
            this.label10.AutoSize = true;
            this.label10.Location = new System.Drawing.Point(7, 23);
            this.label10.Name = "label10";
            this.label10.Size = new System.Drawing.Size(40, 13);
            this.label10.TabIndex = 0;
            this.label10.Text = "Home Page";
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.label8);
            this.groupBox1.Controls.Add(this.txtPASS_MIN_LEN);
            this.groupBox1.Controls.Add(this.txtPASS_VALID);
            this.groupBox1.Controls.Add(this.label7);
            this.groupBox1.FlatStyle = Gizmox.WebGUI.Forms.FlatStyle.Flat;
            this.groupBox1.Location = new System.Drawing.Point(19, 156);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(522, 81);
            this.groupBox1.TabIndex = 5;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Password";
            this.groupBox1.Visible = false;
            // 
            // label8
            // 
            this.label8.AutoSize = true;
            this.label8.Location = new System.Drawing.Point(7, 23);
            this.label8.Name = "label5";
            this.label8.Size = new System.Drawing.Size(86, 13);
            this.label8.TabIndex = 0;
            this.label8.Text = "Pwd. Min Length";
            // 
            // txtPASS_MIN_LEN
            // 
            this.txtPASS_MIN_LEN.AllowDrag = false;
            this.txtPASS_MIN_LEN.Location = new System.Drawing.Point(96, 20);
            this.txtPASS_MIN_LEN.Name = "txtPASS_MIN_LEN";
            this.txtPASS_MIN_LEN.Size = new System.Drawing.Size(100, 20);
            this.txtPASS_MIN_LEN.TabIndex = 0;
            // 
            // txtPASS_VALID
            // 
            this.txtPASS_VALID.AllowDrag = false;
            this.txtPASS_VALID.Location = new System.Drawing.Point(96, 46);
            this.txtPASS_VALID.MaxLength = 15;
            this.txtPASS_VALID.Name = "txtPASS_VALID";
            this.txtPASS_VALID.Size = new System.Drawing.Size(100, 20);
            this.txtPASS_VALID.TabIndex = 1;
            // 
            // label7
            // 
            this.label7.AutoSize = true;
            this.label7.Location = new System.Drawing.Point(7, 49);
            this.label7.Name = "label6";
            this.label7.Size = new System.Drawing.Size(56, 13);
            this.label7.TabIndex = 0;
            this.label7.Text = "Pwd. Valid";
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(16, 41);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(35, 13);
            this.label2.TabIndex = 0;
            this.label2.Text = "Description";
            // 
            // txtROLE_NAME
            // 
            this.txtROLE_NAME.AllowDrag = false;
            this.txtROLE_NAME.Location = new System.Drawing.Point(105, 38);
            this.txtROLE_NAME.Name = "txtROLE_NAME";
            this.txtROLE_NAME.Size = new System.Drawing.Size(436, 20);
            this.txtROLE_NAME.TabIndex = 1;
            // 
            // txtROLE_ID
            // 
            this.txtROLE_ID.AllowDrag = false;
            this.txtROLE_ID.Location = new System.Drawing.Point(105, 12);
            this.txtROLE_ID.MaxLength = 15;
            this.txtROLE_ID.Name = "txtROLE_ID";
            this.txtROLE_ID.Size = new System.Drawing.Size(100, 20);
            this.txtROLE_ID.TabIndex = 0;
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(16, 15);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(35, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "Role ID";
            // 
            // POG
            // 
            this.Controls.Add(this.tabControl1);
            this.DockPadding.All = 3;
            this.Location = new System.Drawing.Point(0, -10);
            this.Padding = new Gizmox.WebGUI.Forms.Padding(3);
            this.Size = new System.Drawing.Size(607, 448);
            this.Load += new System.EventHandler(this.POG_Load);
            ((System.ComponentModel.ISupportInitialize)(this.tabControl1)).EndInit();
            this.tabControl1.ResumeLayout(false);
            this.tbList.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.dgvList)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.bisPOG)).EndInit();
            this.tbDetail.ResumeLayout(false);
            this.groupBox2.ResumeLayout(false);
            this.groupBox1.ResumeLayout(false);
            this.ResumeLayout(false);

        }
        #endregion


        #region IHostedApplication Members

        public void InitializeApplication()
        {
        }

        public void SetObject(object obj)
        {
        }


        public void OnToolBarButtonClick(HostedToolBarButton objButton, EventArgs objEvent)
        {
            try
            {
                sErr = "";
                strAction = (string)objButton.Tag;

                BUS.POGControl ctr = new BUS.POGControl();
                switch (strAction)
                {
                    case "C":
                        AddNew(txtROLE_ID);
                        break;
                    case "A":
                        editRecord(txtROLE_ID);
                        break;
                    case "S":
                        saveRecord(txtROLE_ID);
                        break;
                    case "O":
                        copy(txtROLE_ID);
                        break;
                    case "X":
                        delete(txtROLE_ID);
                        break;
                    case "TI": //trans in
                        importData();
                        break;
                    case "TO": //Tran out
                        export2Xml();
                        break;
                    case "EXCEL": //Tran out
                        export2Excel();
                        break;
                    case "R":
                        reloadList();
                        break;
                    case "P":
                        if (dgvList.CurrentCell != null)
                        {
                            DTO.POGInfo info = new DTO.POGInfo((DataRowView)dgvList.CurrentRow.DataBoundItem);
                            DataTable dt = DTO.POGInfo.ToDataTable();
                            dt.Rows.Add(info.ToDataRow(dt));
                            DataSet ds = new DataSet();
                            ds.Tables.Add(dt);
                            MainForm main = GetMainForm();
                            if (main != null)
                                main.PrintDataSet(ds, _strType);
                        }
                        break;
                }
                
                if (sErr == "")
                    ThrowMsg("Command: " + _processStatus);
            }
            catch (Exception ex)
            {
                ThrowMsg(ex.Message + Environment.NewLine + ex.Source);
            }
        }
        #region .::| Override Functions |::.
        protected override ModuleParent.ErrorStatus validateForm(ref string sErr)
        {
            ErrorStatus result = ErrorStatus.SUCCESS;
            sErr = "";
            if (txtROLE_ID.Text.Trim() == "")
            {
                sErr = "Could not save blank, please check!";
                errProvider.SetError(txtROLE_ID, sErr);
                strAction = _processStatus;
                sErr += "\n";
            }
            else errProvider.SetError(txtROLE_ID, "");
            if (sErr != "") result = ErrorStatus.ERROR;
            return result;
        }
        protected override bool checkExists()
        {
            return new BUS.POGControl().IsExist(txtROLE_ID.Text);
        }
        protected override string addRecord(bool isDraft = false)
        {
            string sErr = "";
            DTO.POGInfo info = GetData();
            BUS.POGControl ctr = new BUS.POGControl();
            ctr.Add(info,ref sErr);
            //UpdateRecord(info);
            return sErr;
        }
        protected override string updateRecord(bool isDraft = false)
        {
            string sErr = "";
            DTO.POGInfo info = GetData();
            BUS.POGControl ctr = new BUS.POGControl();
            sErr= ctr.Update(info);
            //UpdateRecord(info);
            return sErr;
        }
        protected override string delRecord()
        {
            string sErr = "";
            DTO.POGInfo info = GetData();
            BUS.POGControl ctr = new BUS.POGControl();
            sErr = ctr.Delete(txtROLE_ID.Text);
            //UpdateRecord(info);
            return sErr;
        }
       
        protected override void refreshForm(string val)
        {
            txtROLE_ID.Text = val;
            txtROLE_NAME.Text = val;
            txtPASS_MIN_LEN.Text = val;
            txtPASS_VALID.Text = val;
            mcbRPT_CODE.Value = val;
        }
        protected override void enableForm(bool val)
        {
            txtROLE_ID.ReadOnly = !val;
            txtROLE_NAME.ReadOnly = !val;
            txtPASS_MIN_LEN.ReadOnly = !val;
            txtPASS_VALID.ReadOnly = !val;
            mcbRPT_CODE.Enabled = val;
        }
        protected override void reloadList()
        {
            GetMainForm().LoadDataTable(_strType);
            bisPOG.DataSource = GetMainForm().GetTable(_strType);
        }
        protected override void loadRecord(object o)
        {
            if (o is DataRowView)
            {
                DTO.POGInfo inf = new DTO.POGInfo((DataRowView)o);
                SetData(inf);
            }
        }

        #endregion

        
        private DTO.POGInfo GetData()
        {
            return new DTO.POGInfo(txtROLE_ID.Text
                , _strType
                , txtROLE_ID.Text
                , txtROLE_NAME.Text
                , txtPASS_MIN_LEN.Text
                , txtPASS_VALID.Text
                , mcbRPT_CODE.Value
                );

        }

     
        private void SetData(DTO.POGInfo info)
        {
            txtROLE_ID.Text = info.ROLE_ID;
            txtROLE_NAME.Text = info.ROLE_NAME;
            txtPASS_MIN_LEN.Text = info.PASS_MIN_LEN;
            txtPASS_VALID.Text = info.PASS_VALID;
            mcbRPT_CODE.Value = info.RPT_CODE;
        }

        #endregion

        private void POG_Load(object sender, EventArgs e)
        {
            enableForm(false);
            refreshForm("");

            if (!GetMainForm().IsContainsTables("DDB"))
                GetMainForm().LoadDataTable("DDB");
            mcbRPT_CODE.Binding = GetMainForm().GetTable("DDB");
            
            GridLayout layoutDB = new GridLayout(MainForm.ServerPath + "Resources\\Layout\\", String.Format("{0}Documents\\Layout\\{1}\\", MainForm.ServerPath, GetMainForm().PODInfo.USER_ID), "DDB");
            GetMainForm().InitMultiComboBox(mcbRPT_CODE, layoutDB, DTO.LIST_GADGETInfo.Field.Description.ToString(), DTO.LIST_GADGETInfo.Field.ID.ToString());

        
            if (idAllowEditLanguage >= GetMainForm().Permission.Length || GetMainForm().Permission[idAllowEditLanguage] == 'Y')
                AllowEditLanguage();

        }


    }
}
